package com.parser.apk;

/**
 * Created by admin on 2017/12/5.
 */
public class ByteUtil {
    public static short bytesToShort(byte[] bytes, int start) {
        return (short) (((int)(bytes[start + 1]) & 0xFF) << 8 | (bytes[start] & 0xFF));
    }

    public static int bytesToInteger(byte[] bytes, int start) {
        return ((((int)bytes[start + 3] & 0xFF) << 24) | (((int)bytes[start + 2] & 0xFF) << 16) | (((int)bytes[start + 1] & 0xFF) << 8) | ((int)bytes[start] & 0xFF));
    }
}
